<template>
  <div class="myContainer">
    <!-- 头部标题 start -->  
    <el-row class="myHeadeTitle">
      <el-col :span="10" class="myLineHeight_35px">
        巡检任务管理
      </el-col>
      <el-col :span="14" class="myTextAlignRight">
        <el-button type="primary" class="myBgGreen">批量指派</el-button>
        <el-button type="primary" class="myBgGreen" @click="onPush">推送设置</el-button>
        <el-button type="primary" class="myBgGreen" @click="onCount">统计分析</el-button>
        <el-button type="primary" class="myBgGreen">导出</el-button>
      </el-col>
    </el-row>
    <!-- 头部标题 end -->
    <!-- 搜索部分 start -->
    <el-row :gutter="10" class="myPaddingTop_10px">
      <el-col :span="4">
        <template>
          <el-select v-model="modelValue" placeholder="全部项目/小区">
            <el-option
              v-for="item in modelOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </template>
      </el-col>
      <el-col :span="4">
        <template>
          <el-select v-model="modelValue" placeholder="全部维保计划">
            <el-option
              v-for="item in modelOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </template>
      </el-col>
      <el-col :span="4">
        <template>
          <el-select v-model="modelValue" placeholder="全部状态任务类型">
            <el-option
              v-for="item in modelOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </template>
      </el-col>
      <el-col :span="4">
        <template>
          <el-select v-model="modelValue" placeholder="全部任务状态">
            <el-option
              v-for="item in modelOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </template>
      </el-col>
      <el-col :span="4">
        <el-input placeholder="输入关键字进行查询" v-model="kw"></el-input>
      </el-col>
      <el-col :span="4">
        <el-button type="primary" class="myBgGreen"  @click="onSearch">查询</el-button>
      </el-col>
    </el-row>
    <!-- 搜索部分 end -->
    <el-row class="myPaddingTop_10px">
      <el-col :span="24">
        <template>
          <el-table
            border
            :data="tableData"
            style="width: 100%">
            <el-table-column type="expand">
              <template slot-scope="props">
                <el-table
                  border
                  :data="tableData"
                  style="width: 100%">
                  <el-table-column type="expand">
                    <template slot-scope="props">
                      132456798
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="序号"
                    type="index"
                    width="100">
                  </el-table-column>
                  <el-table-column
                    label="所属小区"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="名称"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="状态"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="责任人"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="执行人"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="任务开始时间"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="任务截止时间"
                    prop="name">
                  </el-table-column>
                  <el-table-column
                    label="任务截止时间"
                    prop="name">
                  </el-table-column>
                </el-table>
              </template>
            </el-table-column>
            <el-table-column
              label="序号"
              type="index"
              width="100">
            </el-table-column>
            <el-table-column
              label="所属小区"
              prop="name">
            </el-table-column>
            <el-table-column
              label="名称"
              prop="name">
            </el-table-column>
            <el-table-column
              label="状态"
              prop="name">
            </el-table-column>
            <el-table-column
              label="责任人"
              prop="name">
            </el-table-column>
            <el-table-column
              label="执行人"
              prop="name">
            </el-table-column>
            <el-table-column
              label="任务开始时间"
              prop="name">
            </el-table-column>
            <el-table-column
              label="任务截止时间"
              prop="name">
            </el-table-column>
            <el-table-column
              label="任务截止时间"
              prop="name">
            </el-table-column>
            <el-table-column
              label="功能操作"
              width="100">
              <template scope="scope">
                <el-button class="look" type="text" size="small" @click="onDetailed()">查看</el-button> |
                <el-button class="look" type="text" size="small">检查</el-button> |
                <el-button class="look" type="text" size="small" @click="newRoleDialogVisible = true">指派</el-button>
              </template>
            </el-table-column>
          </el-table>
        </template>
        <!-- 分页控件 start -->
        <div class="block">                    
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="page_num"
            :page-sizes="[10, 15]"
            :page-size="page_size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
          </el-pagination>
        </div>
        <!-- 分页控件 end -->
      </el-col>
    </el-row>
    <el-button type="primary" class="myBgGreen" @click="onDetailed">详情【测试】</el-button>
    <el-button type="primary" class="myBgGreen" @click="onInspect">检查【测试】</el-button>


    <!--指派人员弹出框 start-->
    <el-dialog title="指派执行人员" class="myRoleDialog" :visible.sync="newRoleDialogVisible"  @close="resetForm1('newForm')">
      <el-form :inline="true" >
        <el-form-item>
          <el-input v-model="searchKW" class="myDialogSearchText" placeholder="输入关键字进行搜索"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSearch" class="myBgGreen">搜索</el-button>
        </el-form-item>
      </el-form>
      <div class="mymarginTop_10px myOV_y_400px">
        <el-tree :data="roleData" show-checkbox></el-tree>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" class="myBgGreen" @click="newRoleDialogVisible = false">取 消</el-button>
        <el-button type="primary" class="myBgGreen" @click="newRoleDialogVisible = false">提 交</el-button>
      </div>
    </el-dialog>
    <!--指派人员弹出框 end-->

  </div>
</template>  

<style scoped>
  .myContainer{
    background: #fff;
    padding: 10px;
  }
  .myHeadeTitle{
    color: #000;
    font-weight: 500;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dbdbdb;
    margin-bottom:10px; 
  }
  .myHeadeTitle:before,.myHeadeTitle:after{
    content: " ";
    display: block;
    clear: both;
  }
  .myBgGreen{
    background: #00c2a9;
    border-color: #00c2a9;
    color: #fff;
    margin-top: 2px;
  }
  .myLineHeight_35px{
    line-height: 35px;
  }
  .myTextAlignRight{
    text-align: right;
  }
  .myBgGreen:hover{
    background: #33ceba;
  }
  .myPaddingTop_10px{
    padding-top: 10px;
  }  
  .myLeftMsg{
    line-height: 40px;
    text-align: right;
    padding-right: 10px;
  }
  .myPaddingBottom_10px{
    padding-bottom: 10px;
  }
  .myVA_M{
    vertical-align: middle;
  }
  .myPadding_20px{
    padding: 20px;
  }
  .myDialogSearchText{
    width: 360px;
  }
  .myLineHeight_45px{
    line-height: 45px;    
  }
  .myOV_y_400px{
    max-height: 400px;
    min-height: 200px;
    overflow-y:scroll;
  }
</style>

<script>
  import {} from '@/api/maintenanceplan';
  export default {
     data(){
      return{
        kw:"",
        modelValue:"",
        modelOptions:[],
        tableData: [],
        page_num:1,
        page_size:10,
        total:null,
        newRoleDialogVisible:false,
        roleData:[{label:"角色1"},{label:"角色2"},{label:"角色3"}],
        searchKW:""
      }
    },
    components: {
        
    },
   
    mounted(){
      document.title = '巡检任务管理';
      
     
    },
    methods:{
      onSearchKW:function(val){

      },
      handleSizeChange(val) {//每页条数控制
        this.page_size = val;
      },
      handleCurrentChange(val) {//每页
        this.page_num = val;
      },
      onSearch:function(){

      },
      onDetailed:function(){//查看
        this.$router.push({
          path:'/xjrwglxx',
          query: {type: 'info'}
        })
      },
      onInspect:function(){//检查
        // this.$router.push({
        //   path:'/wbrwgljc',
        //   query: {type: 'info'}
        // })
      },
      onCount:function(){//统计
        this.$router.push({
          path:'/routingInspectionCount',
          query: {}
        })
      },
      onPush:function(){//逾期推送
        this.$router.push({
          path:'/xjpush',
          query: {}
        })
      }
    }

  }

</script>  



